package com.wn.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author yellow Docter
 * @since 2022-06-06
 */
@TableName("t_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String userUuid;

    private String userName;

    private String password;

    private String realName;

    private Integer age;

    private Integer sex;

    /**
     *  处理时间
     * LocalDateTime 改成 Date
     * 时间格式化:
     *  把对象date 转成指定的 字符串  @JsonFormat(pattern = "yyyy-MM-dd:HH:mm:ss")
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    // 把前端的 字符转成 指定的 日期类型
    private Date birthDay;

    private Integer userLevel;

    private String phone;

    private Integer role;

    private Integer status;

    private String imagePath;

    @JsonFormat(pattern = "yyyy-MM-dd:HH:mm:ss")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd:HH:mm:ss")
    private Date modifyTime;

    @JsonFormat(pattern = "yyyy-MM-dd:HH:mm:ss")
    private Date lastActiveTime;

    // 直接使用注解 告诉 mp 标记逻辑删除字段
    // deleted = 0   正常使用
    // deleted = 1   标记删除
    // 查询的时候  mp 会自动进行过滤操作 只查询 deleted = 0

    @TableLogic
    private Integer deleted;

    private String wxOpenId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getUserUuid() {
        return userUuid;
    }

    public void setUserUuid(String userUuid) {
        this.userUuid = userUuid;
    }
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Date getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }
    public Integer getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(Integer userLevel) {
        this.userLevel = userLevel;
    }
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
    public Integer getRole() {
        return role;
    }

    public void setRole(Integer role) {
        this.role = role;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
    public Date getLastActiveTime() {
        return lastActiveTime;
    }

    public void setLastActiveTime(Date lastActiveTime) {
        this.lastActiveTime = lastActiveTime;
    }
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }
    public String getWxOpenId() {
        return wxOpenId;
    }

    public void setWxOpenId(String wxOpenId) {
        this.wxOpenId = wxOpenId;
    }

    @Override
    public String toString() {
        return "User{" +
            "id=" + id +
            ", userUuid=" + userUuid +
            ", userName=" + userName +
            ", password=" + password +
            ", realName=" + realName +
            ", age=" + age +
            ", sex=" + sex +
            ", birthDay=" + birthDay +
            ", userLevel=" + userLevel +
            ", phone=" + phone +
            ", role=" + role +
            ", status=" + status +
            ", imagePath=" + imagePath +
            ", createTime=" + createTime +
            ", modifyTime=" + modifyTime +
            ", lastActiveTime=" + lastActiveTime +
            ", deleted=" + deleted +
            ", wxOpenId=" + wxOpenId +
        "}";
    }
}
